<template>
	<view class="container" :style="{ 'background-color' : bacolor }" @click="jumpSearchHandler">
		<view class="box" :style="{ 'border-radius' : redius + 'px' }">
			<!-- 图标 -->
			<uni-icons type="search" size="17"></uni-icons>
			<!-- 文本 -->
			<text>搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		// 组件名称
		name: "my-search",
		// 接收来自父组件的数据
		props: {
			bacolor: {
				type: String,
				default: '#d81e06'
			},
			redius: {
				type: Number,
				default: 18,
			}
		},
		data() {
			return {

			};
		},
		methods: {
			jumpSearchHandler() {
				this.$emit('click1')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		height: 45px;
		padding: 0 5px;
		display: flex;
		align-items: center;

		.box {
			height: 35px;
			width: 100%;
			line-height: 35px;
			background-color: #ffffff;
			text-align: center;

			text {
				font-size: 15px;
				margin-left: 5px;
			}
		}
	}
</style>